extends "../heianjie-2/heianjie-2.gd"

func _extInit():
	._extInit()
	lv = 3             #等级的设置
	addSkill("每次开炮，向正前方发射1轮弹幕，对受波及的敌人造成[炮击*0.3]的可暴击技能伤害", "弹幕·黑暗界")

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "heianjie2":
		cast()
		yield(reTimer(0.3),"timeout")
		cast()
var p3 = 1
func effInCell(cell):
	var cha = matCha(cell)
	if cha != null and cha.team != team:
		azurHurtChara(cha, att.atk*0.3, sys.HurtType.WEAPON, sys.AtkType.SKILL, "弹幕·黑暗界", true, p3)
var px = 10
var p = 1
func cast():
	if team == 2:
		px = 0
		p = -1
	var eff1:Eff = sys.newEff("animEff", sys.main.map.map_to_world(cell))
	eff1.setImgs(sys.getBasePath() + "/eff/thunderFly", 9, true)
	eff1._initFlyPos(sys.main.map.map_to_world(Vector2(px, cell.y)), 350)
	eff1.normalSpr.position=Vector2(0, -30)
	eff1.connect("onInCell",self,"effInCell")

	var eff2:Eff = sys.newEff("animEff", sys.main.map.map_to_world(cell+Vector2(-1*p, 1)))
	eff2.setImgs(sys.getBasePath() + "/eff/thunderFly", 9, true)
	eff2._initFlyPos(sys.main.map.map_to_world(Vector2(px+1, cell.y+1)), 350)
	eff2.normalSpr.position=Vector2(0, -30)
	eff2.connect("onInCell",self,"effInCell")

	var eff3:Eff = sys.newEff("animEff", sys.main.map.map_to_world(cell+Vector2(-1*p, -1)))
	eff3.setImgs(sys.getBasePath() + "/eff/thunderFly", 9, true)
	eff3._initFlyPos(sys.main.map.map_to_world(Vector2(px, cell.y-1)), 350)
	eff3.normalSpr.position=Vector2(0, -30)
	eff3.connect("onInCell",self,"effInCell")